package com.jiangxfei.mymvp.app.home.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jiangxfei.mymvp.R;
import com.jiangxfei.mymvp.app.home.bean.User;

import java.util.List;

/**
 * @author: JiangXFei
 * @date: 2018/1/9 0009
 * @content:
 */

public class RecyLoadAdapter extends BaseQuickAdapter<User, BaseViewHolder> {


    public RecyLoadAdapter(int layoutResId, @Nullable List<User> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, User item) {
        ImageView imgUser = helper.getView(R.id.img_item_show);
        helper.setText(R.id.tv_item_username, item.getLogin());
        Glide.with(mContext)
                .load(item.getAvatar_url())
//                .apply(new RequestOptions()
//                        .placeholder(R.drawable.ic_launcher_background)
//                        .error(R.drawable.ic_launcher_background))
                .into(imgUser);
    }
}
